/// 求数字为阵的对角线数字之和
pub fn start() {
    let s = r"1234
                    5678
                    9876
                    4321";
    let (mut x, mut y) = (0, 0);
    for (mut idx, mut val) in s.lines().enumerate() {
        val = val.trim();
        let left = val.get(idx..idx + 1).unwrap().parse::<u32>().unwrap();
        let right = val
            .get((3 - idx)..(3 - idx + 1))
            .unwrap()
            .parse::<u32>()
            .unwrap();
        x += left;
        y += right;
    }
    assert_eq!(38, x + y);

    println!("{}", (1, 2, 3) == (3, 2, 1));
}

#[cfg(test)]
mod tests {

    #[test]
    fn test_sum_diagonal_number() {
        super::start();
    }
}
